{% extends 'group_base.html' %}

{% block theme %}
{{my_group.name}} 群组
{% endblock %}

{% block topic_content %}

<div class="infobox">
	<div class="ex1">
		<span></span>
	</div>
	<div class="bd">
		<img align="left" valign="top" class="pil groupicon" src="{{ my_group.logo }}" alt={{ my_group.name }} />
		<p>
			创建于{{my_group.create_datetime|date:"Y-m-j"}}    
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			组长： 
			<a href=""> {{my_group.administrators.all.0.name}} </a>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			{% if is_admin %}
			<a href="/my_group/update_group/{{my_group.id}}/">更改 </a>
			{% endif %}
			<br>
		</p>
		<p>
		{{ description|slice:":50" }}&nbsp;...
		</p>
	</div>
	<div class="ex2">
		<span></span>
	</div>
</div>

<div style="padding-top: 30px">
<h2>添加友情群组 ······</h2>
</div>


{% for group in apply_groups %}
<div class="ul" style="margin-bottom:6px;"></div>
<div class="clist2">
	<a href="">
		<img src="{{group.logo}}" align="left" style="margin:0 20px 0 10px;" alt={{group.name}}>
	</a>
	<div class="pl" style="float:right;">
		创建于{{ group.create_datetime|date:"Y-m-j" }}
		&nbsp;
		{{ group.members.all|length }}人
	</div>
	<div class="pl" style="float:right; padding-right: 20px;">
		已发送请求
	</div>
	<span class="pl2">
		<a href="/group/gr/{{ group.id }}/">{{ group.name }}</a>
	</span>
	<br>
	<!--<div class="pl">{{ group.description|safe }}</div>-->
</div>
<br clear="all">
{% endfor %}

{% for group in groups %}
<div class="ul" style="margin-bottom:6px;"></div>
<div class="clist2">
	<a href="">
		<img src="{{group.logo}}" align="left" style="margin:0 20px 0 10px;" alt={{group.name}}>
	</a>
	<div class="pl" style="float:right;">
		创建于{{ group.create_datetime|date:"Y-m-j" }}
		&nbsp;
		{{ group.members.all|length }}人
	</div>
	<div class="pl" style="float:right; padding-right: 20px;">
		{% if is_apply %}
		已发送请求
		{% else %}
		<a href="/group/apply_friend_group/{{my_group.id}}/{{group.id}}/{{ current_page }}/">添加</a>
		{% endif %}
	</div>
	<span class="pl2">
		<a href="/group/gr/{{ group.id }}/">{{ group.name }}</a>
	</span>
	<br>
	<!--<div class="pl">{{ group.description|slice:":50" }}</div>-->
</div>
<br clear="all">
{% endfor %}

{% endblock %}

{% block aside %}

<div>
<p class="pl2">
	&gt;
	<a href="/group/gr/{{my_group.id}}/">回{{my_group.name}}小组</a>
</p>
</div>

<h2>友情小组 ······</h2>
<div class="obss">
	{% for friend_group in friend_groups %}
	<dl class="ob">
		<dt>
			<a href="/group/gr/{{ friend_group.id }}/">
				<img src="{{ friend_group.logo }}" class="m_sub_img" alt={{ friend_group.name }} style="width:70%;">
			</a>
		</dt>
		<dd>
			<a href="/group/gr/{{ friend_group.id }}/">{{ friend_group.name }}</a>
			<span>({{ friend_group.members.all|length }})</span>
			<span><a href="/group/cancel_friend_group/{{my_group.id}}/{{friend_group.id}}/">解除关系</a></span>
		</dd>
	</dl>
	{% endfor %}
</div>

{% endblock %}